home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / usr (gcc 1.37 libs) / mac / setjmp.c < prev    next >
C/C++ Source or Header  |  1993-03-20  |  697b  |  27 lines

  1. #include <setjmp.h>
  2.  
  3. void longjmp(jmp_buf saved, int result)
  4.     {
  5.     asm        ("unlk       a6\n"
  6.             "        movel    a7@+,a1\n"
  7.             "        movel    a7@+,d0\n"
  8.             "        movel    a7@+,a0\n"
  9.             "        tstl    d0\n"
  10.             "        bne    _1\n"
  11.             "        moveq    #1,d0\n"
  12.             "_1:     moveml    a0@,d3-d7/a1-a4/a6-a7\n"
  13.             "        jmp    a1@\n"
  14.             );
  15.       }
  16.     
  17. int setjmp (jmp_buf save)
  18.     {
  19.     asm        ("unlk       a6\n"
  20.             "        movel    a7@+,a1\n"
  21.             "        movel    a7@,a0\n"
  22.         "        moveq      #0,d0\n"
  23.             "        moveml    d3-d7/a1-a4/a6/a7,a0@\n"
  24.             "        jmp        a1@\n"
  25.             );
  26.     }
  27.